package com.javabi.codegenerator.java.object.serializer.field.xml.type;

import com.javabi.codeobject.java.type.IJavaType;
import com.javabi.codeobject.java.type.set.IJavaTypeSet;
import com.javabi.codetype.serializer.xml.serializer.lang.EnumSerializer;

public class EnumSerializedType extends XmlSerializedType {

	public EnumSerializedType(IJavaType type) {
		super(type);
	}

	@Override
	public void addReferences(IJavaTypeSet set) {
		set.add(getType());
		set.add(EnumSerializer.class);
	}

	@Override
	public String getNewSerializer(String name) {
		String type = getType().getSimpleName();
		return "new EnumSerializer<" + type + ">(" + type + ".class, \"" + name + "\")";
	}
}
